package cn.fldong.model;

import java.sql.Timestamp;
import java.math.BigDecimal;

/**
 * 课程实体类，对应courses表
 */
public class Course {
    private String courseId; // 课程ID
    private String courseName; // 课程名称
    private String courseCode; // 课程代码
    private BigDecimal credit; // 学分
    private int hours; // 课时
    private String semester; // 学期，如：2023-2024-1
    private String teacher; // 授课教师
    private String description; // 课程描述
    private Timestamp createdAt; // 创建时间
    private Timestamp updatedAt; // 更新时间
    
    // 无参构造函数
    public Course() {
    }
    
    // 全参构造函数
    public Course(String courseId, String courseName, String courseCode, BigDecimal credit,
                 int hours, String semester, String teacher, String description,
                 Timestamp createdAt, Timestamp updatedAt) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.credit = credit;
        this.hours = hours;
        this.semester = semester;
        this.teacher = teacher;
        this.description = description;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }
    
    // Getters and Setters
    public String getCourseId() {
        return courseId;
    }
    
    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }
    
    public String getCourseName() {
        return courseName;
    }
    
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    
    public String getCourseCode() {
        return courseCode;
    }
    
    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }
    
    public BigDecimal getCredit() {
        return credit;
    }
    
    public void setCredit(BigDecimal credit) {
        this.credit = credit;
    }
    
    public int getHours() {
        return hours;
    }
    
    public void setHours(int hours) {
        this.hours = hours;
    }
    
    public String getSemester() {
        return semester;
    }
    
    public void setSemester(String semester) {
        this.semester = semester;
    }
    
    public String getTeacher() {
        return teacher;
    }
    
    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public Timestamp getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }
    
    public Timestamp getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }
    
    @Override
    public String toString() {
        return "Course{" +
                "courseId='" + courseId + '\'' +
                ", courseName='" + courseName + '\'' +
                ", courseCode='" + courseCode + '\'' +
                ", credit=" + credit +
                ", hours=" + hours +
                ", semester='" + semester + '\'' +
                ", teacher='" + teacher + '\'' +
                ", description='" + description + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }
}